package com.dormitory_springboot.controller;

import com.dormitory_springboot.bean.Dept;
import com.dormitory_springboot.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @auther 夏杨
 **/
@RestController
@RequestMapping("/dept")
public class DeptController {
    @Autowired
    DeptService deptService;
    @GetMapping("/getAll")
    public List<Dept> getAllDept(){
        return deptService.list();
    }
}
